/*
 * @Author: wangru
 * @Date: 2023-05-29 09:34:55
 * @LastEditors: wangru
 * @LastEditTime: 2023-09-11 15:39:31
 */
import {
  defineStore
} from 'pinia';

export const projectDetailStore = defineStore('projectDetail', {
  state: () => {
    return {
      projectType: 'ZB', //项目类型， ZB,TB,DW  招标，投标，单位
      currentTreeInfo: null, // 左侧树形结构当前点击信息
      constructConfigInfo: null, // 当前项目配置信息
      asideMenuCurrentInfo: null, // 侧边菜单当前选中信息
      feeWithDrawalInfo: null, //取费表侧边选中取费文件信息
      queryCostAnalysisCode: null, //查询造价分析接口传参的code
      subCurrentInfo: null, // 分部分项当前选中数据
      tabSelectName: null, //项目详情上部tab栏选中的类型名称
      proCheckTab: null, //左侧项目点击选中的tab--除单项工程（造价分析)项目
      biddingType: null, //进入项目详情获取到的biddingType决定单位取费表的计税方式是否可选
      unitListString: null, //其他项目单位列表字符串
      dataType: null, //其他项目总承包服务费和计日工选中行数据的dataType
      otherProCopyInfo: null, //其他项目子页面复制行信息
      summaryCopyInfo: null, //费用汇总子页面复制行信息
      humanUpdataData: null, //人材机汇总工程项目级别编辑的数据

    };
  },
  actions: {
    SET_CURRENT_TREE_INFO(info) {
      console.log('info', info);
      this.currentTreeInfo = info;
    },
    SET_CONSTRUCT_CONFIG_INFO(info) {
      this.constructConfigInfo = info;
    },
    SET_ASIDE_MENU_CURRENT_INFO(info) {
      this.asideMenuCurrentInfo = info;
    },
    SET_Fee_With_Drawal_Info(info) {
      this.feeWithDrawalInfo = info;
      console.log(this.feeWithDrawalInfo, 'store.feeWithDrawalInfo');
    },
    SET_Cost_Analysis_Code(code) {
      this.queryCostAnalysisCode = code;
    },
    SET_SUB_CURRENT_INFO(info) {
      this.subCurrentInfo = info;
    },
    SET_TAB_SELECT_NAME(info) {
      this.tabSelectName = info;
    },
    SET_PRO_CHECK_TAB(info) {
      this.proCheckTab = info;
    },
    SET_PRO_BIDDINGTYPE(info) {
      this.biddingType = info;
    },
    SET_UNITLISTSTRING(info) {
      this.unitListString = info;
    },
    SET_DATATYPE(info) {
      this.dataType = info;
    },
    SET_OTHERPRO_COPYINFO(info) {
      this.otherProCopyInfo = info;
    },
    SET_SUMMARY_COPYINFO(info) {
      this.summaryCopyInfo = info;
    },
    SET_HUMAN_UPDATA_DATA(info) {
      this.humanUpdataData = info;
    },
  },
});